﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Huirui.Cavan.Domain.MainBoundedContext.ReportModule;
using Spring.Data.Generic;

namespace Huirui.Cavan.Infrastructure.Data.MainBoundedContext.PurchaseModule
{
    public class PurchaseOrderManageReportMapper : IRowMapper<PurchaseOrderManageReport>
    {
        #region IRowMapper<PurchaseOrderManageReport> 成员

        public PurchaseOrderManageReport MapRow(System.Data.IDataReader reader, int rowNum)
        {
            PurchaseOrderManageReport report = new PurchaseOrderManageReport();
            report.Code = reader.GetString(0);
            report.PurchaseDate = reader.GetDateTime(1).ToShortDateString();
            report.SupplierName = reader.GetString(2);
            report.SupplierInvoiceNumber = reader.GetString(3);
            report.Currency = reader.GetString(4);
            report.CurrencyRate = reader.GetDecimal(5);
            report.Amount = reader.GetDecimal(6);
            report.ProjectName = reader.GetString(7);
            report.PurchaseEmployeeCode = reader.GetString(8);
            report.DeliveryDate = reader.GetDateTime(9).ToShortDateString();
            report.WareHouseCode = reader.GetString(10);
            report.Address = reader.GetString(11);
            report.StockInStatus = reader.GetInt32(12).ToString();
            report.ProducerEmployeeCode = reader.GetString(13);
            report.CheckEmployeeCode = reader.GetString(14);
            report.CheckedStatus = reader.GetInt32(15).ToString();
            return report;
        }

        #endregion
    }
}
